classdef FrequencyShiftFilter < Filter 
	
properties
end % end of properties

methods 

	function obj = FrequencyShiftFilter(Name, LoopOrder, Bandwidth, ...
 																			DetectorGain, IntegrationTime)
		obj = obj@Filter(Name, LoopOrder, Bandwidth, DetectorGain, IntegrationTime);
		obj.filter1 = @obj.filter1Frequency;
		obj.filter2 = @obj.filter2Frequency;
		obj.filter3 = @obj.filter3Frequency;
 	end	

end % end of methods 

methods (Access = protected)

	function out = filter1Frequency(obj, DiscriminatorOut)
		out = DiscriminatorOut * obj.Coefficients(1); 
	end

	function out = filter2Frequency(obj, DiscriminatorOut)
		out = DiscriminatorOut * obj.Coefficients(1) + obj.States(1);
		obj.States(1) = obj.States(1) + obj.Coefficients(1) * ...
	 									obj.Coefficients(2) * DiscriminatorOut;	
	end
	
	function out = filter3Frequency(obj, DiscriminatorOut)
		out = DiscriminatorOut * obj.Coefficients(1) +obj.States(1) +obj.States(2);
		obj.States(2) = obj.States(2) + obj.Coefficients(3) * obj.States(1);
		obj.States(1) = obj.States(1) + obj.Coefficients(1) * ...
	 									obj.Coefficients(2) *	DiscriminatorOut;
	end

end % end of methods

end % end of class
